class Solution {
    public String modifyString(String s) {
        StringBuilder stringBuilder = new StringBuilder();
        for(int i = 0; i < s.length(); i++){
            char ch = s.charAt(i);
            if(ch == '?'){
                for(char tmp = 'a'; tmp <= 'z'; tmp++){
                    if((i == 0 || tmp != stringBuilder.charAt(i - 1)) && (i == s.length() - 1 || tmp != s.charAt(i + 1))){
                        ch = tmp;
                        break;
                    }
                }
            }
            stringBuilder.append(ch);
        }
        return stringBuilder.toString();
    }
}
